<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <link rel="stylesheet" href="../../common/common.css"/>
    <link rel="stylesheet" href="../../css/Token_Start.css"/>
 	<script src="../../js/jquery-3.2.1.min.js"></script>   
 	<script type="text/javascript">
 		$().ready(e=>{
 			var imgOne1=sessionStorage.getItem("TradeImgName1");//存入币
 		    var imgTwo2=sessionStorage.getItem("TradeImgName2");//转化币
 			$.ajax({
 				url:"/sys/exchangeRate/rate",
 			   	data:{turnout:imgOne1,receive:imgTwo2},
 			   	success:function(r){
 			   		console.log("汇率",r);
 			   		var data=r.doGet;
 			   		if(data.error){
 			   		$("#Transaction_exchange_rate").html(data.error);
 			   		$("#targetadd").attr("disabled","disabled");
 			   		$("#refundadd").attr("disabled","disabled");
 			   		return true;
 			   		}
 			   		$.get("/app/public/ssw",function(r){
 			   		var rate=` <span>1${imgOne1}</span> = <span>${data.rate} ${imgTwo2}</span>`;
 			   		var html=`<li><span>最低存储额 </span><span class='Transaction_Math'>${data.minimum}ANT</span></li>
 			        <li><span>最高储存额 </span><span class='Transaction_Math'>${data.maxLimit}ANT</span></li>
 			        <li><span>旷工</span><span class="Transaction_Math">${data.minerFee}BLK</span></li>
 			        <li><span>消耗</span><span class="Transaction_Math">${r.charge} ssw</span></li>`
 			   		$("#Transaction_exchange_rate").html(html);
 			   		$("#exchangeRate").html(rate);
 			   		})
 			   		
 			   	}
 			})
 		})
 	
 	</script>
</head>
<body>
<header class="Transaction_header">
    <strong class="Token_Transaction"><img src="../../img/left.png" alt=""/></strong>
    <span>
        <span class="Transaction_Font">即时汇率</span>
      <p id="exchangeRate"> <span>1ANT</span> = <span>_ _BLK</span></p>
    </span>
</header>
<div class="Transaction_exchange_rat">
    <ul id="Transaction_exchange_rate">
        <li><span>最低存储额 </span><span class="Transaction_Math">_ _ANT</span></li>
        <li><span>最高储存额 </span><span class="Transaction_Math">_ _ANT</span></li>
        <li><span>旷工</span><span class="Transaction_Math">_ _ BLK</span></li>
        <li><span>消耗</span><span class="Transaction_Math">_ _ BLK</span></li>
    </ul>
</div>
<div class="Transaction_Exchange_img">
    <span><img src="https://shapeshift.io/images/coins/bitcoin.png" alt="" id="tradeDHone"/><strong id="Trading_Name1">BTH</strong></span>
    <span><img src="../../img/right.png" alt=""/></span>
    <span><img src="https://shapeshift.io/images/coins/ether.png" alt=""  id="tradeDHtwo"/><strong id="Trading_Name2">ETC</strong></span>
</div>

<div class="Transaction_Exchange_Input">
    <input type="text" id="targetadd" placeholder="您的Blackcoin地址 (目标地址)"/>
</div>
<div class="Transaction_Exchange_Input">
    <input type="text" id="refundadd" placeholder="您的Aragon退款地址"/>
</div>
<div class="Transaction_Exchange_Input_Err">
	<p class="input_err">输入信息错误</p>
</div>
<div class="Transaction_Exchange_Terms">
    <ul>
        <li><span class="Exchange_OK"><img src="../../img/Yes.png" alt=""/> </span> <span><a href=""> 同意服务条款</a></span></li>
        <li>设置为常用地址</li>
    </ul>
</div>

<div class="Transaction_Request">
    <span id="Transaction_OK">开 始 交 易</span>
</div>


<script src="../../js/Token_Start.js"></script>
<script src="js/token_trading_transaction.js"></script>
<script>
$().ready(function(){
    var imgOne=sessionStorage.getItem("TradeImgOne");
    var imgTwo=sessionStorage.getItem("TradeImgTwo");

    var imgOne1=sessionStorage.getItem("TradeImgName1");
    var imgTwo2=sessionStorage.getItem("TradeImgName2");

    if(imgOne){$("#tradeDHone").attr("src",imgOne)}
    if(imgTwo){$("#tradeDHtwo").attr("src",imgTwo)}

    if(imgOne1){$("#Trading_Name1").html(imgOne1)}
    if(imgTwo2){$("#Trading_Name2").html(imgTwo2)}
  //旷工汇率
    
})

 

</script>
</body>
</html>